package com.qeado.content.dao.ibatis;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.qeado.common.dao.BaseDao;
import com.qeado.content.dao.NewsPublishManageDao;
import com.qeado.content.model.NewsPublish;

@Repository
@SuppressWarnings("unchecked")
public class NewsPublishManageDaoImpl extends BaseDao implements NewsPublishManageDao {

	@Override
	public void deleteNews(String id) {
		getSqlMapClientTemplate().delete("deleteNews", id);
	}

	@Override
	public List<NewsPublish> getNewsSortList() {
		return getSqlMapClientTemplate().queryForList("getNewsSortList");
	}

	@Override
	public void insertNews(NewsPublish news) {
		getSqlMapClientTemplate().insert("insertNews", news);
	}

	@Override
	public List<NewsPublish> newsPublishSearch(NewsPublish news) {
		return getSqlMapClientTemplate().queryForList("newsPublishSearch", news);
	}

	@Override
	public NewsPublish searchNewsPublishById(String id) {
		return (NewsPublish) getSqlMapClientTemplate().queryForObject("searchNewsPublishById", id);
	}

	@Override
	public void updateNews(NewsPublish news) {
		getSqlMapClientTemplate().insert("updateNews", news);
	}
}
